<template>
  <div id="main">
    <h1>欢迎您：{{ username }}</h1>
    <div>{{ msg }}</div>
  </div>
</template>

<script>
import {get} from "../../common/request";

export default {
  name: "Main",
  data() {
    return {
      username: this.$store.getters.getUser.username,
      msg: ""
    }
  },
  mounted() {
    let params = {
      userid: this.$store.getters.getUser.userId
    }
    get("/sys/getLastLoginTime", params).then(x => {
      if (x.code === 1) {
        this.msg = x.data.studentLastLoginTime;
      }
    })
  }
}
</script>

<style scoped>
  #main {
    background-color: rgb(240,240,240);
    display: flex;
    flex-direction: column;
    align-items: center;
  }
</style>
